package com.zhu.library_management_system.service;

import com.zhu.library_management_system.pojo.BookBorrowing;

import java.sql.Timestamp;
import java.time.LocalDateTime;

public interface BookBorrowingService {
    /**
     * 借书
     * @param bookBorrowing
     */
    public void borrowBook(BookBorrowing bookBorrowing);

    /**
     * 还书
     * @param bookBorrowing
     */
    public void returnBook(BookBorrowing bookBorrowing);

    /**
     * 获取约定还书日期
     * @param id
     * @return
     */
    public LocalDateTime getReturnDate(Integer id);

    /**
     * 获取所有借阅记录
     * @return
     */
    public Iterable<BookBorrowing> findBookBorrowingAll();

    /**
     * 获取借阅记录
     * @param id
     * @return
     */
    public BookBorrowing findBookBorrowingById(Integer id);

    /**
     * 获取用户借阅记录
     * @param userId
     * @return
     */
    public Integer countUserBorrowing(Integer userId);
}
